Simple CJS model integrated with a growth in weight model to get phi, p, and growth estimates to compare with Neural Network CMR/growth model
In all the models below, 1 = not observed and 2 = observed in the input encounter data.
Encounter data are available here in the eh.csv file. Weight data are in weight.csv
19.0.1 modelNum 1: g(i,t) model
Growth rate (gr) model structure:
gr(t,i) <- grInt(t,i)
Model code is in ./models/cmrNN_OB/tt_growth/modelCMR_tt_growth_NN_OB_functionsToSource.R
Model is run ‘by hand’ in ./models/cmrNN_OB/tt_growth/modelCMR_tt_growth_NN_OB_makeFile.R Not using this: Targets are loaded in R/modelCMR_tt_growth_NN_OB.R and saved as modelCMR_tt_growth_NN_OB_target
In the model code, a value of 1 for z or in gamma or omega signifies the individual is alive and a value of 2 signifies the individual is dead. y[i,j] is the observed data (encounter history file).
Code
out_NN_OBmod1$modelCode
{
for (i in 1:N) {
weight[i, first[i]] ~ dnorm(meanWeight_AIS[first[i]],
sd = 2)
weightDATA[i, first[i]] ~ dnorm(weight[i, first[i]],
sd = 0.2)
for (t in (first[i]):(last[i] - 1)) {
weight[i, t + 1] <- weight[i, t] + gr[i, t] * sampleIntervalDATA[i,
t]/90
weightDATA[i, t + 1] ~ dnorm(weight[i, t + 1], sd = 0.2)
}
}
for (i in 1:N) {
for (t in first[i]:(last[i] - 1)) {
gr[i, t] ~ dnorm(grIntT[t], sd = 0.5)
}
}
for (t in 1:(T - 1)) {
grIntT[t] ~ dnorm(0, sd = 1000)
}
}
Black dots/line is estimated mass and orange dots are observed masses. The green line is the first observation and the red line is the last observation. The number in the upper right corner of each panel is the fish’s cohort. Green dots are estimated growth rates.
19.0.2 modelNum 2: phi(i,t) + g(i,t), p(i,t) model
Model with phi and p for each age-in-samples (t = column in the encounter history file) and individual (i)
Probability of survival (phi) model structure:
phi(t,i) <- phiInt(t,i)
Probability of capture (p) model structure:
p(t,i) <- pInt(t,i)
Growth rate (gr) model structure:
gr(t,i) <- grInt(t,i)
Survival/growth rate interaction:
Additive
Model code is in ./models/cmrNN_OB/tt_growth/modelCMR_tt_growth_NN_OB_functionsToSource.R
Model is run ‘by hand’ in ./models/cmrNN_OB/tt_growth/modelCMR_tt_growth_NN_OB_makeFile.R Not using this: Targets are loaded in R/modelCMR_tt_growth_NN_OB.R and saved as modelCMR_tt_growth_NN_OB_target
In the model code, a value of 1 for z or in gamma or omega signifies the individual is alive and a value of 2 signifies the individual is dead. y[i,j] is the observed data (encounter history file).
Code
out_NN_OBmod2$modelCode
{
for (i in 1:N) {
weight[i, first[i]] ~ dnorm(3.7, sd = 1.7)
weightDATA[i, first[i]] ~ dnorm(weight[i, first[i]],
sd = 0.2)
for (t in first[i]:(last[i] - 1)) {
weight[i, t + 1] <- weight[i, t] + gr[i, t] * sampleIntervalDATA[i,
t]
weightDATA[i, t + 1] ~ dnorm(weight[i, t + 1], sd = 0.2)
}
}
for (i in 1:N) {
for (t in first[i]:(last[i] - 1)) {
gr[i, t] ~ dnorm(grIntT[t], sd = 0.33)
}
}
for (t in 1:(T - 1)) {
grIntT[t] ~ T(dnorm(0, sd = 1.5), -3.5, 3.5)
grIntTOut[t] <- ilogit(grIntT[t])
}
delta[1] <- 1
delta[2] <- 0
for (i in 1:N) {
for (t in first[i]:(last[i] - 1)) {
gamma[1, 1, t, i] <- phi[i, t]
gamma[1, 2, t, i] <- 1 - phi[i, t]
gamma[2, 1, t, i] <- 0
gamma[2, 2, t, i] <- 1
}
}
for (t in 1:(T - 1)) {
p[t] ~ dunif(0, 1)
omega[1, 1, t] <- 1 - p[t]
omega[1, 2, t] <- p[t]
omega[2, 1, t] <- 1
omega[2, 2, t] <- 0
}
for (i in 1:N) {
for (t in first[i]:(last[i] - 1)) {
logit(phi[i, t]) <- phiInt[i, t]
}
}
for (i in 1:N) {
for (t in first[i]:(last[i] - 1)) {
phiInt[i, t] ~ dnorm(phiIntT[t], sd = 2)
}
}
for (t in 1:(T - 1)) {
phiIntT[t] ~ T(dnorm(0, sd = 1.5), -3.5, 3.5)
phiIntTOut[t] <- ilogit(phiIntT[t])
}
for (i in 1:N) {
z[i, first[i]] ~ dcat(delta[1:2])
for (j in first[i]:(last[i] - 1)) {
z[i, j + 1] ~ dcat(gamma[z[i, j], 1:2, j, i])
yDATA[i, j + 1] ~ dcat(omega[z[i, j + 1], 1:2, j])
}
}
}
Black dots/line is estimated mass and orange dots are observed masses. The green line is the first observation and the red line is the last observation. The number in the upper right corner of each panel is the fish’s cohort.
Black dots/line is estimated probability of survival and orange dots are encountered yes (y = 0.8)/no (y = 0). The green line is the first observation and the red line is the last observation. The number in the upper right corner of each panel is the fish’s cohort.